package com.liunian.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liunian.subject.common.enums.IsDeletedFlagEnum;
import com.liunian.subject.infra.basic.entity.SubjectMultiple;
import com.liunian.subject.infra.basic.mapper.SubjectMappingMapper;
import com.liunian.subject.infra.basic.mapper.SubjectMultipleMapper;
import com.liunian.subject.infra.basic.service.SubjectMultipleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SubjectMultipleServiceImpl extends ServiceImpl<SubjectMultipleMapper, SubjectMultiple> implements SubjectMultipleService {

    @Resource
    private SubjectMultipleMapper subjectMultipleMapper;

    @Override
    public List<SubjectMultiple> selectMultipleAnswer(long subjectId) {
        LambdaQueryWrapper<SubjectMultiple> wrapper = new LambdaQueryWrapper<>();
        return subjectMultipleMapper.selectList(wrapper
                .eq(SubjectMultiple::getSubjectId, subjectId)
                .eq(SubjectMultiple::getIsDeleted, IsDeletedFlagEnum.UN_DELETED.getCode()));
    }
}
